home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 008a / fglqbx10.zip / 05-14.BAS < prev    next >
BASIC Source File  |  1991-06-06  |  1KB  |  70 lines

  1. REM $INCLUDE: 'fastgraf.bi'
  2.  
  3. DEFINT A-Z
  4.  
  5. REM Ask for the video mode number
  6.  
  7. INPUT "Which video mode"; Mode
  8.  
  9. REM Make sure the entered value is valid
  10.  
  11. IF Mode < 0 OR Mode > 21 THEN
  12.    PRINT Mode; "is not a valid video mode number."
  13.    STOP
  14. END IF
  15.  
  16. REM Make sure the requested video mode is available
  17.  
  18. IF FGtestmode(mode,1) = 0 THEN
  19.    PRINT "Mode"; Mode; "is not available on this system."
  20.    STOP
  21. END IF
  22.  
  23. REM Establish the video mode
  24.  
  25. OldMode = FGgetmode
  26. FGsetmode Mode
  27.  
  28. REM Perform mode-specific initializations
  29.  
  30. IF Mode <= 3 OR Mode = 7  THEN    ' text modes
  31.    FGcursor 0
  32.  
  33. ELSEIF Mode = 4 OR Mode = 5 THEN ' CGA color modes
  34.    FGpalette 0, 0
  35.    FGdefcolor 14, 3
  36.  
  37. ELSEIF Mode = 6 THEN             ' CGA two-color mode
  38.    FGpalette 0, 14
  39.    FGdefcolor 14, 1
  40.  
  41. ELSEIF Mode = 11 THEN            ' Hercules mode
  42.    FGdefcolor 14, 1
  43.  
  44. ELSEIF Mode = 12 THEN            ' Hercules low-res mode
  45.    FGdefcolor 14, 3
  46.  
  47. ELSEIF Mode = 17 THEN            ' VGA two-color mode
  48.    FGpalette 1, 14
  49.    FGsetrgb 14, 63, 63, 21
  50.    FGdefcolor 14, 1
  51. END IF
  52.  
  53. REM Display a message that includes the video mode number
  54.  
  55. FGsetcolor 14
  56. FGtext "I'm running in mode", 19
  57. FGtext STR$(Mode), LEN(STR$(Mode))
  58. FGtext ".", 1
  59.  
  60. REM Wait for a keystroke
  61.  
  62. FGwaitkey
  63.  
  64. REM Restore the original video mode and screen attributes
  65.  
  66. FGsetmode OldMode
  67. FGreset
  68.  
  69. END
  70.